import axios from "axios";
import { BASE_URL } from "../Constant";
const PHONE_BASE_URL = BASE_URL + '/phone'

export const savePhone = (data:any) =>{
    return axios.post(
        PHONE_BASE_URL + '/save',
        data
    )
}

export const getMemoryList = () => {
    return axios.get(
        PHONE_BASE_URL + '/getMemory'
    )
}

export const listPhoneByAttr = (data:any) => {
    return axios.post(
        PHONE_BASE_URL + '/search',
        data
    )
}
export const getPhoneCountByAttr = (data:any) => {
    return axios.post (
        PHONE_BASE_URL + '/count',
        data
    )
}

export const getDiskList = () => {
    return axios.get(
        PHONE_BASE_URL + '/getDisk'
    )
}

export const getPhoneById = (id:any) => {
        return axios.get(
        PHONE_BASE_URL + `/getOne?id=${id}`
    )
}

export function pageList (start:number,offset:number) {
    return axios.get (
        PHONE_BASE_URL + `/pageList?start=${start}&offset=${offset}`
    )
}
export const count = () => {
    return axios.get(
        PHONE_BASE_URL + '/count'
    )
}

export const upOrDownApi = (data:any) => {
    return axios.post(
        PHONE_BASE_URL + '/upOrDown',
        data
    )
}

export const phoneChangeApi = (data:any) =>{
    return axios.post(
        PHONE_BASE_URL + '/change',
        data
    )
}


